package org.wangblue;

import org.wangblue.concrete_aggregate.ConcreteAggregate;
import org.wangblue.concrete_iterator.ConcreteIterator;
import org.wangblue.iterator.Iterator;

/**
 * @Description: 运行类
 * @Author: WangBlue
 * @Create: 2024-09-23 10:21
 * @Version: 1.0
 **/

public class Main {
    public static void main(String[] args) {
        ConcreteAggregate items = new ConcreteAggregate();
        items.add("张三");
        items.add("李四");
        items.add("王五");
        items.add("赵六");

        Iterator iterator = new ConcreteIterator(items);
        iterator.fist();
        while (!iterator.hasNext()) {
            System.out.println(iterator.currentItem() + " 请买车票");
            iterator.next();
        }


    }
}
